#include <stdio.h>
#include <algorithm>
using namespace std;

#define rep(i,n) for (int i=0; i<n; i++)

#define TRACE(x...) x 
#define PRINT(x...) TRACE(printf(x))

#define INF 0x3f3f3f3f

int m, n, k;
int rs[1010];
int r, c;
int sum;

int main() {
	scanf("%d %d %d", &n, &m, &k);

	rep(i,m) rs[i]=INF;
	PRINT("%d\n", INF);

	rep(i,n) {
		scanf("%d %d", &r, &c);
		r--;
			
		rs[r]=min(rs[r], c);		
	}

	TRACE(
		rep(i,m) printf("%d ", rs[i]);
		printf("\n");
	)

	sum=0;

	rep(i,m) sum+=rs[i];

	PRINT("%d\n", sum);

	printf("%d\n", min(k, sum));

	return 0;
}
